import axios from 'axios'



 const http=async function(){
    function But(){
        return new Promise((resolve,reject)=>{
            // resolve({a:1,b:2})
            // reject({err:500})
            const data={
                params:{
                    a:"132"
                }
            }
            const header={
                header:{
                    "Contene-Type":"application/json"
                }
            }
            //application/x-www-form-urlencoded
            axios.get("http://localhost:8000/tp5/publica/index/Http/index",data,header).then(
               (res)=>{resolve(res)}
            ).catch(()=>{
                (res)=>{reject(res)}
            })
        })
    }

    return await But();
}
const h=function(){

}
const install=function(Vue,options){
    Vue.prototype.$http=async function(){
        function But(){
            return new Promise((resolve,reject)=>{
                // resolve({a:1,b:2})
                // reject({err:500})
                const data={
                    params:{
                        a:"132"
                    }
                }
                const header={
                    header:{
                        "Contene-Type":"application/json"
                    }
                }
                //application/x-www-form-urlencoded
                axios.get("http://localhost:8000/tp5/publica/index/Http/index",data,header).then(
                   (res)=>{resolve(res)}
                ).catch(()=>{
                    (res)=>{reject(res)}
                })
            })
        }
    
        return await But();
    }
}
export default{
    install
}